/*============================================================================*/
/*  Copyright (C) 2009-2014, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  @file       <Can_Cfg.h>
 *  @brief      <>
 *  
 *  <MCU:TC1782>
 *  
 *  @author     <>
 *  @date       <2016-08-31 13:16:45>
 */
/*============================================================================*/

	
#ifndef CAN_CFG_H
#define CAN_CFG_H
 
/*=======[F I L E  V E R S I O N   I N F O R M A T I O N]===============================*/
#define CAN_CFG_H_AR_MAJOR_VERSION     3U 
#define CAN_CFG_H_AR_MINOR_VERSION     1U 
#define CAN_CFG_H_AR_PATCH_VERSION     5U 
#define CAN_CFG_H_SW_MAJOR_VERSION     1U
#define CAN_CFG_H_SW_MINOR_VERSION     0U
#define CAN_CFG_H_SW_PATCH_VERSION     0U 
 
/*=======[R E L E A S E   V E R S I O N   I N F O R M A T I O N]===============================*/
#define CAN_VENDOR_ID                 62U         /* Replace with a symbolic name once available */
#define CAN_MODULE_ID                 80U         /* from AUTOSAR_BasicSoftwareModules.pdf */
#define CAN_INSTANCE                  0U
#define CAN_AR_MAJOR_VERSION          2U 
#define CAN_AR_MINOR_VERSION          4U 
#define CAN_AR_PATCH_VERSION          0U 
#define CAN_SW_MAJOR_VERSION          1U
#define CAN_SW_MINOR_VERSION          0U
#define CAN_SW_PATCH_VERSION          0U 

/*=======[I N C L U D E S]====================================================*/
#include "ComStack_Types.h"

/*=======[M A C R O S]========================================================*/
/*
 * Variants Class (PC, PB)
 */
#define CAN_VARIANT_PC                VARIANT_PRE_COMPILE
#define CAN_VARIANT_PB                VARIANT_POST_BUILD
#define CAN_VARIANT_CFG               CAN_VARIANT_PC

/*
 * CanGeneral
 */
#define CAN_DEV_ERROR_DETECT            STD_OFF    /* development error detection */
#define CAN_DEM_ERROR_DETECT            STD_OFF   /* public error detection */

#define CAN_HW_TRANSMIT_CANCELLATION    STD_OFF    /* transmision cancel */
#define CAN_MULTIPLEXED_TRANSMISSION    STD_OFF    /* multiplexed transmision */
#define CAN_WAKEUP_SUPPORT              STD_OFF   /* wakeup */
#define CAN_VERSION_INFO_API            STD_OFF    /* version info get API */

/* max. number of tight SW loops to execute while waiting for a state change */
#define CAN_TIMEOUT_DURATION            10000

#define CAN_MAINFUNCTION_BUSOFFPERIOD   100U
#define CAN_MAINFUCTION_WRITEPERIOD     100U
#define CAN_MAINFUNCTION_READPERIOD     100U
#define CAN_MAINFUNCTION_WAKEUPPERIOD   100U

/* Instance Id of the module instance */
#define CAN_INDEX                       0U


#define  CAN_MCR_REG_VALUE 0x0U


/* 
 * CanController
 */
/* Can controller id */
#define CAN_CONTROLLER_0                0

#define CAN_CONTROLLER_1                1

#define CAN_CONTROLLER_2                2



#define CAN_MAX_CONTROLLERS             1

/* CanBusOffProcessing */
/* CanRxProcessing */
/* CanTxProcessing */
#define CAN_CONTROLLER0_BUSOFF_INTERRUPT     STD_OFF
#define CAN_CONTROLLER0_RX_INTERRUPT         STD_OFF
#define CAN_CONTROLLER0_TX_INTERRUPT         STD_OFF
#define CAN_CONTROLLER1_BUSOFF_INTERRUPT     STD_OFF
#define CAN_CONTROLLER1_RX_INTERRUPT         STD_OFF
#define CAN_CONTROLLER1_TX_INTERRUPT         STD_OFF
#define CAN_CONTROLLER2_BUSOFF_INTERRUPT     STD_OFF
#define CAN_CONTROLLER2_RX_INTERRUPT         STD_OFF
#define CAN_CONTROLLER2_TX_INTERRUPT         STD_OFF

#define CAN_BUSOFF_POLLING                   STD_ON
#define CAN_RX_POLLING                       STD_ON
#define CAN_TX_POLLING                       STD_ON


#define CAN_STEP        0x3FFU

#define CAN_MAX_HARDWAREOBJECTS              3
#define CAN_MAX_HOHS                         3

/* hardware mailbox num */
#define CAN_HW_MAX_MAILBOXES                 128U

/* CAN base address */
#define CAN_BASE_ADDR                0xF0004000U

/* CAN Mb base address */
#define CAN_MB_BASE_ADDR             0xF0005000U


#endif /* #define CAN_CFG_H */

/*=======[E N D   O F   F I L E]==============================================*/